home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / pvquan16.zip / PACMAN.POV < prev    next >
Text File  |  1992-12-01  |  6KB  |  281 lines

  1. // Persistence of Vision Raytracer
  2. // pacman.dat
  3. // Based on pacman.dat by Ville Saari
  4. // Copyright (c) 1991 Ferry Island Pixelboys
  5. /*
  6. * PvRay scene description for 'Pac Man doing his favourite job'
  7. * Created: 03-Jan-91
  8. * Updated: 05-Jan-91
  9. *
  10. * You will need pacman.iff which is included in this package.
  11. *
  12. * If you do some nice modifications or additions to this file, please send 
  13. * me a copy. My Internet address is:
  14. *
  15. *         vsaari@niksula.hut.fi
  16. */
  17.  
  18. #include "shapes.inc"
  19. #include "colors.inc"
  20.  
  21. /* For 3d views, the following was used to calculate the right eye position,
  22.   to give 5 degrees convergence at (40,10,0)
  23.  
  24. For left eye:
  25.   Distance to focal point      = sqrt((40+80)^2+(0+140)^2)
  26.                                = 184.39
  27.   Direction focal point to eye = atan((40+80)/(0+140))
  28.                                = -130.6 degrees
  29.  
  30. For right eye:
  31.   Direction focal point to eye = -130.6 + 5
  32.                                = -125.6 degrees
  33.   x coordinate                 = 40 + cos(-125.6) * 184.39
  34.                                = -67.34
  35.   z coordinate                 = 0 + sin(-125.6) * 184.39
  36.                                = -149.93
  37. */
  38.  
  39. #declare eye_pos            = <-80.0 35.0 -140>
  40. // #declare eye_pos         = <-67.34 35.0 -149.93>   Uncomment for right eye
  41.  
  42. camera {                 
  43.    location eye_pos
  44.  
  45.    direction <0.0 0.0 1.0>
  46.    up  <0.0  1.0  0.0>
  47.    right <1.1922 0.0 0.0>
  48.  
  49.    sky <0.0 1.0 0.0>
  50.    look_at <40.0 10.0 0>
  51.  }
  52.  
  53. object { /* The maze-textured ground */
  54.    plane { <0.0 1.0 0.0> 0.0  }
  55.    texture {
  56.       image_map { <1.0 0.0 -1.0> iff "pacman.iff" 
  57.        interpolate 2.0
  58.        }
  59.       scale <1600.0 1600.0 1600.0>
  60.       translate <-196.0 0.0 160.0>
  61.       ambient 0.3
  62.       diffuse 0.7
  63.       reflection 0.5
  64.     }
  65.  }
  66.  
  67. #declare eye = composite {
  68.    object {
  69.       sphere { <0.0 0.0 0.0> 6.0  }
  70.       texture {
  71.          colour red 1.0 green 1.0 blue 1.0
  72.          ambient 0.3
  73.          diffuse 0.7
  74.          reflection 0.5
  75.        }
  76.     }
  77.  
  78.    object { /* Iris */
  79.       sphere { <0.0 0.0 -2.3> 4.0  }
  80.       texture {
  81.          colour red 0.3 green 0.4 blue 0.8
  82.          ambient 0.3
  83.          diffuse 0.7
  84.          reflection 0.5
  85.        }
  86.     }
  87.  
  88.    object { /* Pupil */
  89.       sphere { <0.0 0.0 -5.5> 1.0  }
  90.       texture {
  91.          colour red 0.0 green 0.0 blue 0.0
  92.          ambient 0.3
  93.          diffuse 0.7
  94.          reflection 0.5
  95.        }
  96.     }
  97.  }
  98.  
  99. #declare food = object {
  100.    sphere { <0.0 0.0 0.0> 4.0  }
  101.  
  102.    texture {
  103.       colour red 1.0 green 1.0 blue 1.0
  104.       ambient 0.3
  105.       diffuse 0.7
  106.       specular 2.0
  107.       roughness 0.01
  108.       reflection 0.6
  109.     }
  110.  }
  111.  
  112. composite { /* And now the world famous... Ta Da! ... pac man */
  113.  
  114.    object { /* Body */
  115.       intersection {
  116.          sphere { <0.0 0.0 0.0>  30.0  }
  117.          sphere { <0.0 0.0 0.0>  28.0 inverse  }
  118.          union {
  119.             plane { <0.0 1.0 0.0> 0.0 rotate <@lip_lower@ 0.0 0.0>  }
  120.             plane { <0.0 -1.0 0.0> 0.0 rotate <@lip_upper@ 0.0 0.0>  }
  121.           }
  122.  
  123.          sphere { <0.0 0.0 -29.0> 1.5     /* Nostril */
  124.             inverse
  125.             rotate <16.0 -4.0 0.0>
  126.           }
  127.  
  128.          sphere { <0.0 0.0 -29.0> 1.5     /* Nostril */
  129.             inverse
  130.             rotate <16.0 4.0 0.0>
  131.           }
  132.        }
  133.  
  134.       texture {
  135.          colour red 0.9 green 0.8
  136.          ambient 0.3
  137.          diffuse 0.7
  138.          specular 0.5
  139.          roughness 0.1
  140.        }
  141.     }
  142.    
  143.    object { /* Mouth */
  144.       intersection {
  145.          sphere { <0.0  0.0  0.0>  28.0  }
  146.          union {
  147.             plane { <0.0 2.0 0.0> -2.0 rotate <@lip_lower@ 0.0 0.0>  }
  148.             plane { <0.0 -2.0 0.0> -2.0 rotate <@lip_upper@ 0.0 0.0>  }
  149.           }
  150.        }
  151.    
  152.       texture {
  153.          ambient 0.25
  154.          diffuse 0.75
  155.          colour red 0.5
  156.        }
  157.     }
  158.    
  159.    object { /* Tongue */
  160.       union {
  161.          sphere { <3.0 0.0 -15.0> 10.0  }
  162.          sphere { <-3.0 0.0 -15.0> 10.0  }
  163.        }
  164.       rotate <-45.0 0.0 0.0>
  165.  
  166.       texture {
  167.          colour red 1.0
  168.          wrinkles 0.5
  169.          scale <0.5 0.5 0.5>
  170.          ambient 0.3
  171.          diffuse 0.7
  172.          reflection 0.5
  173.        }
  174.     }
  175.  
  176.    composite { eye        /* Right eye */
  177.       rotate <-5.0 -15.0 @r_eye_dir@>
  178.       translate <-8.0 +10.988 -23.564>
  179.     }
  180.  
  181.    composite { eye        /* Left eye */
  182.       rotate <-5.0 15.0 @l_eye_dir@>
  183.       translate <+8.0 +10.988 -23.564>
  184.     }
  185.  
  186.    object {  /* Right Eye-brow */
  187.       quadric { Ellipsoid  }
  188.       scale <9.0 2.0 9.0>
  189.       translate <0.0 8.0 6.0>
  190.       rotate <0.0 0.0 @r_eyebrow_angle@>
  191.       rotate <-25.0 -20.0 0.0>
  192.       translate <0.0 0.0 -26.0>
  193.       rotate <25.0 20.0 0.0>
  194.       texture {
  195.          colour red 0.0 green 0.0 blue 0.0
  196.        }
  197.     }
  198.    
  199.    object { /* Left Eye-brow */
  200.       quadric { Ellipsoid  }
  201.       scale <9.0 2.0 9.0>
  202.       translate <0.0 8.0 6.0>
  203.       rotate <0.0 0.0 @l_eyebrow_angle@>
  204.       rotate <-25.0 20.0 0.0>
  205.       translate <0.0 0.0 -26.0>
  206.       rotate <25.0 -20.0 0.0>
  207.       texture {
  208.          colour red 0.0 green 0.0 blue 0.0
  209.       }
  210.    }
  211.  
  212.    bounded_by {
  213.       sphere { <0.0 0.0 -2.0> 32.0  }
  214.    }
  215.  
  216.    rotate <0 @pac_dir@ 0>
  217.    translate <@pac_x@ 32.0 @pac_z@>
  218. }
  219.  
  220. &f1_exists
  221. object { food
  222.    translate <@food_x@ 27.0 @food1_z@>
  223. }
  224. &
  225.  
  226. &f2_exists
  227. object { food
  228.    translate <@food_x@ 27.0 @food2_z@>
  229. }
  230. &
  231.  
  232. &f3_exists
  233. object { food
  234.    translate <@food_x@ 27.0 @food3_z@>
  235. }
  236. &
  237.  
  238. &f4_exists
  239. object { food
  240.    translate <@food_x@ 27.0 @food4_z@>
  241. }
  242. &
  243.  
  244. &f5_exists
  245. object { food
  246.    translate <@food_x@ 27.0 @food5_z@>
  247. }
  248. &
  249.  
  250. &f6_exists
  251. object { food
  252.    translate <@food_x@ 27.0 @food6_z@>
  253. }
  254. &
  255.  
  256. &f7_exists
  257. object { food
  258.    translate <@food_x@ 27.0 @food7_z@>
  259. }
  260. &
  261.  
  262. &f8_exists
  263. object { food
  264.    translate <@food_x@ 27.0 @food8_z@>
  265. }
  266. &
  267.  
  268. object {   /* Light source */
  269.    union {
  270.       sphere {
  271.          <60.0 120.0 -170.0> 2.0
  272.          texture { color White ambient 1 diffuse 0 }
  273.       }
  274.       light_source { <60.0 120.0 -170.0> color White }
  275.    }
  276.    no_shadow
  277. }
  278.  
  279.  
  280.